home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.06 Jun 91 / Fancy Dialogs Code / Test Dialogs.p < prev    next >
Encoding:
Text File  |  1991-03-18  |  1.0 KB  |  57 lines  |  [TEXT/PJMM]

  1. { Test dialogs main program. }
  2.  
  3. { Written by Thomas Engel, M.D. }
  4. { Copyright © 1991 MacTutor. }
  5.  
  6.  
  7. {$I-}
  8. program TestDialogs;
  9.  
  10.     uses
  11.         Globals, TDialog;
  12.  
  13.     var
  14.         theButton: Integer;
  15.         response: Str255;
  16.         fontSize: Integer;
  17.         margins: MarginRecord;
  18.         confirmed: Boolean;
  19.  
  20. begin
  21.  
  22.     { Initialize system. }
  23.  
  24.     MaxApplZone;
  25.     MoreMasters;
  26.     InitGraf(@thePort);
  27.     InitFonts;
  28.     InitWindows;
  29.     InitMenus;
  30.     TEInit;
  31.     InitDialogs(nil);
  32.     InitCursor;
  33.     FlushEvents(EveryEvent, 0);
  34.     IBeam := GetCursor(IBeamID);
  35.     Watch := GetCursor(WatchID);
  36.  
  37.     { Test each dialog. }
  38.  
  39.     ShowAbout;
  40.     ShowMessage('This is a message.');
  41.  
  42.     theButton := YesNoDialog('This is the prompt. (Yes)', YesButton);
  43.     theButton := YesNoCancelDialog('This is the prompt. (Cancel)', CancelButton);
  44.  
  45.     response := 'This is the default text.';
  46.     confirmed := StringDialog('This is the prompt.', response);
  47.  
  48.     fontSize := 12;
  49.     confirmed := FontSizeDialog(fontSize);
  50.  
  51.     margins.measure := inches;
  52.     margins.top := 1.0;
  53.     margins.bottom := 1.5;
  54.     margins.left := 1.25;
  55.     margins.right := 1.25;
  56.     confirmed := MarginsDialog(margins);
  57. end.